package com.token.model.dto;

import com.token.service.Predicate;

/**
 * @auther: henriy
 * @Date: 2023/12/29
 */
public class PredicateTest {

    private final Predicate<String> predicate;

    public PredicateTest(Predicate<String> predicate) {
        this.predicate = predicate;
    }

    public boolean test(String str) {
        return predicate.test(str);
    }

    public static void main(String[] args) {
        PredicateTest example = new PredicateTest(String::isEmpty);
        // true
        System.out.println(example.test(""));
        // false
        System.out.println(example.test("Hello"));
    }

}
